package com.ruoyi.crm.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.ReturnPurchaseMapper;
import com.ruoyi.crm.domain.ReturnPurchase;
import com.ruoyi.crm.service.IReturnPurchaseService;

/**
 * 采购退货单Service业务层处理
 *
 * @author ruoyi
 * @date 2021-08-31
 */
@Service
public class ReturnPurchaseServiceImpl implements IReturnPurchaseService
{
    @Autowired
    private ReturnPurchaseMapper returnPurchaseMapper;

    /**
     * 查询采购退货单
     *
     * @param id 采购退货单主键
     * @return 采购退货单
     */
    @Override
    public ReturnPurchase selectReturnPurchaseById(String id)
    {
        return returnPurchaseMapper.selectReturnPurchaseById(id);
    }

    /**
     * 查询采购退货单列表
     *
     * @param returnPurchase 采购退货单
     * @return 采购退货单
     */
    @Override
    public List<ReturnPurchase> selectReturnPurchaseList(ReturnPurchase returnPurchase)
    {
        return returnPurchaseMapper.selectReturnPurchaseList(returnPurchase);
    }

    /**
     * 新增采购退货单
     *
     * @param returnPurchase 采购退货单
     * @return 结果
     */
    @Override
    public int insertReturnPurchase(ReturnPurchase returnPurchase)
    {
        return returnPurchaseMapper.insertReturnPurchase(returnPurchase);
    }

    /**
     * 修改采购退货单
     *
     * @param returnPurchase 采购退货单
     * @return 结果
     */
    @Override
    public int updateReturnPurchase(ReturnPurchase returnPurchase)
    {
        returnPurchase.setUpdateTime(DateUtils.getNowDate());
        return returnPurchaseMapper.updateReturnPurchase(returnPurchase);
    }

    /**
     * 批量删除采购退货单
     *
     * @param ids 需要删除的采购退货单主键
     * @return 结果
     */
    @Override
    public int deleteReturnPurchaseByIds(String[] ids)
    {
        return returnPurchaseMapper.deleteReturnPurchaseByIds(ids);
    }

    /**
     * 删除采购退货单信息
     *
     * @param id 采购退货单主键
     * @return 结果
     */
    @Override
    public int deleteReturnPurchaseById(String id)
    {
        return returnPurchaseMapper.deleteReturnPurchaseById(id);
    }
}